package com.bangbangu.account.action;

import org.apache.struts2.dispatcher.DefaultActionSupport;
import org.apache.struts2.json.annotations.JSON;

import com.bangbangu.account.model.Account;
import com.bangbangu.account.service.RegisterService;

public class RegisterAction extends DefaultActionSupport {
	private RegisterService regService;
	
	private String accountId;
	
	private String password;
	
	public String execute() throws Exception{
		return SUCCESS;
	}
	
	public String register() throws Exception{
		Account account = new Account();
		account.setAccountId(accountId);
		account.setPassword(password);
		regService.register(account);
		return SUCCESS;
	}

	@JSON(serialize=false)
	public RegisterService getRegService() {
		return regService;
	}

	public void setRegService(RegisterService regService) {
		this.regService = regService;
	}

	@JSON(serialize=false)
	public String getAccountId() {
		return accountId;
	}

	public void setAccountId(String accountId) {
		this.accountId = accountId;
	}

	@JSON(serialize=false)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	
}
